<script src="<?php echo base_url() ?>commons/tablas/media/js/jquery.js" type="text/javascript"></script>
<script src="<?php echo base_url() ?>commons/tablas/media/js/jquery.dataTables.js" type="text/javascript"></script>
<script src="<?php echo base_url() ?>commons/tablas/extras/TableTools/media/js/ZeroClipboard.js" type="text/javascript"></script>
<script src="<?php echo base_url() ?>commons/tablas/extras/TableTools/media/js/TableTools.js" type="text/javascript"></script>

<style type="text/css" title="currentStyle">
			@import "<?php echo base_url() ?>commons/tablas/media/css/demo_page.css";
			@import "<?php echo base_url() ?>commons/tablas/media/css/demo_table.css";
                        @import "<?php echo base_url() ?>commons/tablas/extras/TableTools/media/css/TableTools.css";
		</style>
<script type="text/javascript">
    var t=jQuery.noConflict();
			t(document).ready(function() {
				t('#example').dataTable( {
					"sPaginationType": "full_numbers",
                                         
                  "sDom": 'T C lfrtip', 
                   "fnFooterCallback": function( nFoot, aData, iStart, iEnd, aiDisplay )
        {
 
            var tot = 0;
            for (var i=0; i<aData.length; i++)
            {
                tot += (aData[i][5]=="X"?1:0);
            }
            var valor = document.getElementById("valor");
            valor.value=tot;
            
            var tot = 0;
            for (var i=0; i<aData.length; i++)
            {
                tot += (aData[i][6]=="X"?1:0);
            }
            
            var valor = document.getElementById("valor1");
            valor.value=tot;

        },
                    "oTableTools": { 
                    "sSwfPath": "<?php echo base_url() ?>commons/tablas/extras/TableTools/media/swf/copy_csv_xls_pdf.swf", 
                    "aButtons": [ 
                    "xls",], 
                    },
               } );
	} );
</script>

<form class="well form-horizontal span8" action="<?php echo base_url() . "admin.php/rpt_matricula/imprimir" ?>" method="post">
    <legend>REPORTES DE MATRICULADOS POR CARRERA</legend>
    <div class="control-group">
        <label class="control-label" for="select03">CARRERAS: <?php echo $nombre_car; ?></label>
        <label class="control-label" for="select03">CICLO  : <?php echo $nombre_cic;?></label>
        <label class="control-label" for="select03">SECCION:<?php echo $nom_seccion;?></label>
        
    </div>  
    
    <div id="tablamatriculai" >
        <table id="example" class="table table-bordered table-striped table-condensed">
            
            <thead>
                <tr>
                    <th>Nro</th>
                    <th>CEDULA</th>
                    <th>APELLIDOS</th>
                    <th>NOMBRES</th>
                    <th>PAR</th>
                    <th>HOMBRE</th>
                    <th>MUJER</th>
                </tr>
            </thead>
            <tbody>
                <?php
                $fila=1;
                $s_h=0;
                $s_m=0;
                //print_r($reporte);
                
                if (!empty($reporte)) {
                    foreach ($reporte as $i => $repor) {
                        ?>
                        <tr>
                            <td ><?php echo $fila;?></td>
                            <td><?php echo $repor['cedula_pers'] ?></td>
                            <td><?php echo $repor['apellido_pers'] ?></td>
                            <td><?php echo $repor['nombre_pers']; echo($repor['estado_matr']==5?"(R)":""); ?></td>
                            <td><?php echo $repor['paralelo']; ?></td>
                            <td><?php echo ($repor['sexo_pers']=="HOMBRE"?"X":" ");
                                      $s_h=$s_h+($repor['sexo_pers']=="HOMBRE"?1:0);  ?></td>
                            <td><?php echo ($repor['sexo_pers']=="MUJER"?"X":" "); 
                                      $s_m=$s_m+($repor['sexo_pers']=="MUJER"?1:0);  ?></td>
                        </tr>
                        <?php
                        $fila+=1;
                    }
                }
                ?>
                   <!--     <tr>
                            <td>0</td>
                            <td> </td>
                            <td></td>
                            <td></td>
                            <td>TOTAL</td>
                            <td><div><?php echo $s_h; ?></div></td>
                            <td><div><?php echo $s_m; ?></div></td>
                        </tr>
                   -->
           
            <tfoot>
<tr>
<th> </th>
<th></th>
<th></th>
<th></th>
<th>Total</th>
<th><input type="text" readonly="true" id="valor" class="input-medium span1"  name="valor" value= ""> </th>
<th > <input type="text" readonly="true" id="valor1" class="input-medium span1"  name="valor1" value= ""></th> 

</tr>
</tfoot>
 </tbody>
        </table>  
    </div>
    <input type="hidden" <?php echo "name='ide_lec' value='" . $ide_lec . "'"; ?>>
    <input type="hidden" <?php echo "name='ide_car' value='" . $ide_car . "'"; ?>>
    <input type="hidden" <?php echo "name='ide_pen' value='" . $ide_pen . "'"; ?>>
    <input type="hidden" <?php echo "name='ide_ciclo' value='" . $ide_ciclo . "'"; ?>>
    <input type="hidden" <?php echo "name='seccion' value='" . $seccion . "'"; ?>>
    <input type="hidden" <?php echo "name='paralelo' value='" . $paralelo . "'"; ?>>
    <input type="hidden" <?php echo "name='sexo_pers' value='" . $sexo_pers . "'"; ?>>
    <input type="hidden" <?php echo "name='autodefin_pers' value='" . $autodefin_pers . "'"; ?>>


        <div class="controls">
                <button type="submit" class="btn">imprimir</button>

        </div> 


</form>

